package com.yanqu.road.logic.sort;

import com.yanqu.road.entity.grandchild.GrandChildChampion;

import java.util.Comparator;

public class GrandChildChampionSort implements Comparator<GrandChildChampion> {

    @Override
    public int compare(GrandChildChampion o1, GrandChildChampion o2) {
        if (o2.getCount() != o1.getCount()) {
            return o2.getCount() - o1.getCount() > 0 ? 1 : -1;
        }
        if (o1.getUpdateTime() != o2.getUpdateTime()) {
            return o1.getUpdateTime() - o2.getUpdateTime() > 0 ? 1 : -1;
        }
        return 0;
    }

}
